/*
 * main.cpp
 *
 *  Created on: 03.04.2011
 *      Author: mifodix
 */
#include <stdio.h>
//#include <sys/socket.h>
//#include <netinet/in.h>
//#include <sys/types.h>
//#include <arpa/inet.h>
#include <stdlib.h>
#include <cstdlib>

//#include "SocketUDP.hpp"
//#include "PacketEditor.hpp"
//
//int main()
//{
//	SocketUDP sock;
//	if (!sock.Bind("0.0.0.0", 3001, true))
//	{
//		printf("cant bind\n");
//	}
//	else
//	{
//		PacketEditor pe;
//		pe.SetXid(128);
//		pe.AddOption(53, 2, "22");
//		size_t ps;
//		char *packet=pe.GetPacket(ps);
//		int i=sock.Send(packet, ps, "255.255.255.255", 3002);
//		printf("%i", i);
//	}
//	return 0;
//}

//#include "ConfigParser.hpp"
//#include <list>
//#include <algorithm>
//
//int main(int argc, char * argv[])
//{
//	ConfigParser parser;
//	Settings *s=parser.parse("test.txt");
//	char mac[6]={0x18, 0x17, 0x16, 0x15, 0x14, 0x13};
//	MacIP ip1(mac, 6, 0x18171615);
//	MacIP ip2=ip1;
//	return 0;
//}

//#include <boost/thread.hpp>
//#include <list>
//#include <iostream>
//
//boost::shared_mutex shmutex;
//std::list<int> l;
//
//void thread_func_read(int num)
//{
//	shmutex.lock_shared();
//	std::cout<<"Thread read "<<num<< " Data: ";
//	for (std::list<int>::iterator it=l.begin(); it!=l.end(); ++it)
//	{
//		std::cout<<*it<<" ";
//	}
//	std::cout<<std::endl;
//	sleep(5);
//	shmutex.unlock_shared();
//}
//
//void thread_func_write(int num)
//{
//	shmutex.lock_upgrade();
//	shmutex.unlock_upgrade_and_lock();
//	std::cout<<"Thread write "<<num<<std::endl;
//	l.push_front(100);
//	sleep(5);
//	shmutex.unlock_and_lock_upgrade();
//	shmutex.unlock_upgrade();
//}
//
//int main()
//{
//	boost::thread_group thrds;
//	l.push_back(10);
//	l.push_back(20);
//	l.push_back(30);
//	l.push_back(40);
//	thrds.add_thread(new boost::thread(thread_func_read, 1));
//	thrds.add_thread(new boost::thread(thread_func_read, 2));
//	thrds.add_thread(new boost::thread(thread_func_read, 3));
//	thrds.add_thread(new boost::thread(thread_func_write, 4));
//	thrds.add_thread(new boost::thread(thread_func_write, 5));
//	thrds.join_all();
//	return 0;
//}

#include "DHCPServer.hpp"

int main()
{
	DHCPServer::GetInstance()->start("test.txt");
	return 0;
}
